package com.atguigu.spring6.aop.annoaop;

import org.springframework.stereotype.Component;

@Component
public class CalculatorImpl implements Calculator {

    @Override
    public int add(int i, int j) {
        int result=i+j;
        System.out.println("方法内部 "+"结果是"+result);
        //为了测试，模拟异常出现
        int a=1/0;
        return result;
    }

    @Override
    public int sub(int i, int j) {
        int result=i-j;
        System.out.println("sub 方法内部 "+"结果是"+result);
        return 0;
    }

    @Override
    public int mul(int i, int j) {
        return 0;
    }

    @Override
    public int div(int i, int j) {
        return 0;
    }
}
